<template>
  <ul class="address-list">
    <address-list-item
      v-for="(item, index) in addresses"
      :key="index"
      :item="item"
      :index="index"
      :current-index="currentIndex"
      :is-mark="isMark"
      @editCurrentIndex="editCurrentIndex"
    />
  </ul>
</template>

<script>
import AddressListItem from "./AddressListItem";
export default {
  data() {
    return {
      currentIndex: 0
    }
  },
  props: {
    isMark: {
      type: Boolean,
      default: false
    },
    addresses: {
      type: Array,
      default() {
        return [];
      },
    }
  },
  methods: {
    editCurrentIndex(index) {
      this.currentIndex = index
    }
  },
  components: {
    AddressListItem,
  },
};
</script>
<style lang="less" scoped>
.address-list {
  color: #333333;
}
</style>